Skip to content

Conversation

@thangqp
Copy link
Contributor

@thangqp thangqp commented Nov 24, 2025

PR Summary

Using uuid (instead of name) as primary key for all model-related entities

What did in this PR:

  • For entities which define instants (Model, ModelSetsGroupEntity, ModelParameterSetEntity, ModelParameterEntity), we remove all id classes, i.e. ModelParameterId, ModelParameterSetId, ModelSetsGroupId which contain duplicated infos, and replace by id with type UUID

  • For entities which define definitions (ModelParameterDefinitionEntity, ModelVariableDefinitionEntity, ModelVariableSetEntity), we add id field beside the exisiting name field.

  • All relations are now modelized through ids but we keep name for all entities.

  • Add id fields for corresponding dtos to round-trip id for update actions

  • Adapt existing implementation in ModelServiceImpl for importing correctly model in json format in taking into account the reuse of parameter definitions, and variable definitions.

  • Add models in json format and bash script into /resource to bootstrap initial models

Related PR front : gridsuite/griddyna-app#164

Signed-off-by: Thang PHAM <phamthang37@gmail.com>
Signed-off-by: Thang PHAM <phamthang37@gmail.com>
Signed-off-by: Thang PHAM <phamthang37@gmail.com>
Signed-off-by: Thang PHAM <phamthang37@gmail.com>
Signed-off-by: Thang PHAM <phamthang37@gmail.com>
Signed-off-by: Thang PHAM <phamthang37@gmail.com>
…ting sets by name in groups

Signed-off-by: Thang PHAM <phamthang37@gmail.com>
],
"setsGroups": [
{
"name": "IEEE14_TCB_1",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Naming with prefix IEEE14 for TCB is the demand of @gautierbureau

"family": "VOLTAGE",
"model": "TapChangerBlockingAutomaton",
"setGroup": "TCB_2_4",
"setGroup": "IEEE14_TCB_1",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adapt to the naming with prefix IEEE14 for TBC (demanded by @gautierbureau )

etiennehomer
etiennehomer previously approved these changes Dec 9, 2025
@etiennehomer etiennehomer self-requested a review December 9, 2025 09:27
@etiennehomer etiennehomer dismissed their stale review December 9, 2025 09:28

Review again

@Table(name = "model_parameter", indexes = {@Index(name = "model_parameter_name_index", columnList = "name")})
public class ModelParameterEntity implements Serializable {

@EqualsAndHashCode.Include
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And this ?

Copy link
Contributor Author

@thangqp thangqp Dec 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NO, see the above explaination.

Signed-off-by: Thang PHAM <phamthang37@gmail.com>
…facto_entities' into rework_on_model_by_using_uuid_refacto_entities
@sonarqubecloud
Copy link

@thangqp thangqp merged commit be5c74a into main Dec 11, 2025
4 checks passed
@thangqp thangqp deleted the rework_on_model_by_using_uuid_refacto_entities branch December 11, 2025 13:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants